package com.xuecheng.teaching.api;

import com.xuecheng.commons.model.dto.CommentStatusDto;
import com.xuecheng.commons.model.dto.PageRequest;
import com.xuecheng.commons.model.vo.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
import com.xuecheng.commons.model.dto.WorkDto;

import java.util.List;

@FeignClient("xc-teaching-service")
public interface TeachingClient {


    //评论分页数据查询
    @PostMapping("/course-comment/list")
    PageResponseResult<List<CommentReplyVo>> pageCommentMange(@RequestParam PageRequest request, @RequestBody CommentStatusDto dto);

    //根据id删除
    @DeleteMapping("/course-comment/{commentId}")
    public ResponseResult deleteComment(@PathVariable("commentId") Integer commentId);

    //评论信息模糊查询
    @GetMapping("/searchByContentName")
    PageResponseResult<List<CommentReplyVo>> pageByName(@RequestParam("courseName") String courseName);

    //门户详情页----课程评论统计
    @GetMapping("/course-comment/course-statistics/{targetId}")
    public ResponseResult<StarRankVo> countCourseComment(@PathVariable("targetId") Integer targetId);

    //  根据id查询课程计划作业
    @GetMapping("/work/{workId}")
    public ResponseResult<WorkVo> findById(@PathVariable("workId") Long workId);

    //新增或修改作业
    @PostMapping("/work")
    public ResponseResult saveOrUpdateWork(@RequestBody WorkDto dto);

    //根据课程id查询
    @GetMapping("/findMsgByCourseId")
    public ResponseResult<CourseWorkRecVo> findMsgByCourseId(@RequestParam("courPubId") Long courPubId);
}
